home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000019_icon-group-sender _Wed Jan 17 06:31:40 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 17 Jan 1996 08:43:24 MST
  2. Date: Wed, 17 Jan 1996 06:31:40 -0600 (CST)
  3. From: "Chris D. Tenaglia" <cdt@post.its.mcw.edu>
  4. To: Hamish Lawson <H.Lawson@tees.ac.uk>
  5. Cc: icon-group@cs.arizona.edu
  6. Subject: Re: Initialising tables
  7. In-Reply-To: <4B78DE79AC@scm_arkengarthdale.tees.ac.uk>
  8. Message-Id: <Pine.ULT.3.90.960117062302.15155A-100000@post.its.mcw.edu>
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: O
  13.  
  14. I do it two ways depending on whether the initials are
  15. constants or may change. If they are constants I actually do:
  16.  
  17. contbl := table("n/a")
  18. contbl["xx-xx-xx"] := "###=#+##"
  19. contbl["xx-xxx-x"] := "##+###++"
  20. contbl["xxx-x-xx"] := "##-=##_#"
  21. ...
  22.  
  23. If the case of configurable tables I put them in a file, perhaps
  24. referenced by an environmental variable.
  25.  
  26. confile := getenv("CONFTAB") | ".conftab"
  27. (in := open(confile)) | stop("Missing ",confile)
  28. conftab := table("n/a")
  29. every line := !in do
  30.   conftab[parse(line,' \t')[1]] := parse(line,' \t')[2]
  31. close(in)
  32.  
  33. Chris Tenaglia   (system manager)     |  cdt@post.its.mcw.edu
  34. Medical College of Wisconsin          |
  35. 8701 W. Watertown Plank Rd.           |  Ce que vous voyez est
  36. Milwaukee, WI 53226   (414)456-8765   |  ce que vous obtenez !
  37.  
  38. On Sat, 13 Jan 1996, Hamish Lawson wrote:
  39.  
  40. > Date: Sat, 13 Jan 1996 14:58:33 GMT0BST
  41. > From: Hamish Lawson <H.Lawson@tees.ac.uk>
  42. > To: icon-group@cs.arizona.edu
  43. > Subject: Initialising tables
  44. > Is there an quick way to initialise tables, along the lines of the
  45. > list assignment below?
  46. >    aList := ["this","list","is","a","list"]
  47. > I've cooked up the following, but is there a more concise way?
  48. >    aTable := table()
  49. >    every entry := ![["bob",2],["sue",5],["fred",12],["mary",9]] do
  50. >       aTable[entry[1]] := entry[2]
  51. > | Hamish Lawson, School of Computing and Mathematics, 
  52. > | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA 
  53. > | Tel: +44 1642 218121 x3611  Fax: +44 1642 342604
  54. > | E-mail: H.Lawson@tees.ac.uk 
  55.